/**
 * @author NBao
 */
$(document).ready(function() {
	
	$("#change_pass_dialog").dialog({
		width: 400,
		resizable : false,
		autoOpen : false
	});
	
	$("a.change_password").click(function(){
		var id_change = $(this).attr('id_change');
		//alert(id_change);
		//$('.cls_title').attr('value', $(this).html());
		$('#change_pass_dialog').dialog('open');
		$('input#changeID').val(id_change);
		return false;
	});
	
	var options = { 
	    //target:     '#change_pass_dialog',
	    dataType: 'json',
	    success: function(responseContent) { 
    	    alert(responseContent.message);
	        if (!responseContent.error) {
	        	$('#changeUserPassword')[0].reset();
    	        $("#change_pass_dialog").dialog('close');
            }
	    } 
	};
	
	$('#changeUserPassword').ajaxForm(options);
});